const goodsItem = require("./goodsItem")
module.exports = app => {
    const mongoose = app.mongoose;
    const Schema = mongoose.Schema;
    const UserSchema = new Schema({
        "userId": {
            type:String
        },
        "name":{
            type:String
        },
        "pass": {
            type:String
        },
        "cartList":[
            {
               ...goodsItem,
               checked:{
                   type:Boolean,
                   default:true
               },
               productNum:{
                   type:Number,
                   default:1
               }
            }
        ]
    });
    return mongoose.model('User', UserSchema, "user");
}